@extends('Admin.layout.layout')
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>IM 聊天记录管理</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row hide">
                            <form action="/foradmin/im/record" method="GET">
                                <div class="col-sm-12">
                                    <a class="btn-sm btn-primary" href="/foradmin/im/create/record">添加</a>
                                </div>
                            </form>
                        </div>
                        <table class="table table-striped table-bordered table-hover dataTable" id="editable">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>对话用户A</th>
                                <th>对话用户B</th>
                                <th>创建时间</th>
                                <th>最后更新时间</th>
                                <th class="center">操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            @if(!empty($list))
                                @foreach($list as $value)
                                    <tr class="gradeX">
                                        <td>{{array_get($value, 'id')}}</td>
                                        <td>{{array_get($value, 'im_id_a')}}</td>
                                        <td>{{array_get($value, 'im_id_b')}}</td>
                                        <td>{{array_get($value, 'created_at')}}</td>
                                        <td>{{array_get($value, 'updated_at')}}</td>
                                        <td class="center">
                                            <a class="btn btn-xs btn-warning" href="/foradmin/record/{{$value['id']}}">查看会话</a>
                                        </td>
                                    </tr>
                                @endforeach
                            @else
                                <tr class="no-records-found center"><td colspan="8">没有找到匹配的聊天记录</td></tr>
                            @endif
                            </tbody>
                        </table>
                        <div class="row">
                            @include('Admin.common.paginate', ['page' => $page])
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
